* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.function-selector {
    display: flex;
    background: #f8f9fa;
    padding: 15px;
    gap: 10px;
}

.func-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.func-btn.active {
    background: #4facfe;
    color: white;
}

.input-area {
    padding: 20px;
}

#user-input {
    width: 100%;
    height: 120px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    resize: vertical;
    font-size: 16px;
}

#submit-btn {
    width: 100%;
    padding: 15px;
    margin-top: 15px;
    background: #4facfe;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#submit-btn:hover {
    background: #3a9df4;
}

.result-area {
    padding: 0 20px 20px;
}

.hidden {
    display: none;
}

#loading {
    text-align: center;
    padding: 30px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4facfe;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#ai-response {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #4facfe;
    white-space: pre-wrap;
    line-height: 1.6;
}